import request from '@/utils/request'

// 获取文章分类
export const articleGetChannelService = () => {
    return request.get('/my/cate/list')
}

// 添加文章分类
export const articleAddChannelService = (data) => {
    return request.post('/my/cate/add', data)
}

// 编辑文章分类
export const articleEditChannelService = (data) => {
    return request.put('/my/cate/info', data)
}

// 删除文章分类
export const articleDelChannelService = (id) => {
    return request.delete('/my/cate/del', {
        params: { id }
    })
}

// 获取文章列表
export const articleGetListService = (params) => {
    return request.get('/my/article/list', {
        params
    })
}

// 发布文章
export const artPublishService = (data) => {
    return request.post('/my/article/add', data)
}

// 获取文章详情
export const artDetailService = (id) => {
    return request.get('/my/article/info', {
        params: { id }
    })
}

// 编辑文章接口
export const artUpdateService = (data) => {
    return request.put('/my/article/info', data)
}